﻿#include "stdafx.h"
#include "EXELoad.h"

EXELoad::EXELoad(CString filename)
{
	memset(&si, 0, sizeof(STARTUPINFO));
	si.cb = sizeof(STARTUPINFO);
	si.dwFlags = STARTF_USESHOWWINDOW;
	si.wShowWindow = SW_SHOW;
	//std::string file(filename.GetBuffer(0));  
	if (!CreateProcess(nullptr, filename.GetBuffer(0), nullptr, nullptr, FALSE, 0, nullptr, nullptr, &si, &pi)) //8888为命令行参数  
	{
		std::cout << "杰瑞U盘监视器加载失败！" << std::endl;
		exit(1);
	}
}